from time import sleep
from selenium import webdriver

# 打开浏览驱动器
driver = webdriver.Chrome()
driver.implicitly_wait(3)
# 将浏览器最大化
driver.maximize_window()
# 访问兔展工作台
driver.get('https://www.rabbitpre.com/')

# 查找登录按钮并点击按钮
signin_button = driver.find_element_by_css_selector('#g-j-signin-btn')
signin_button.click()
sleep(3)
# 定位元素
login_iframe = driver.find_element_by_css_selector('#sso')
driver.switch_to.frame(login_iframe)

account_button = driver.find_element_by_css_selector('span[data-type="tuzhan"]')
account_button.click()

username = driver.find_element_by_css_selector('[placeholder="请输入你的登录账户"]')
username.send_keys('rabbit')

password = driver.find_element_by_css_selector('[placeholder="请输入密码"]')
password.send_keys('aaaaaa')

login_button = driver.find_element_by_css_selector('button.g-btn.login-btn.do-btn')
login_button.click()

sleep(3)
# 关闭浏览器
driver.quit()


